package oop1.src.extend;

public class ExtendsDemo {
    public static void main(String[] args) {
        Dog d = new Dog();
        d.showName();
    }
}
class Animal{
    public String name = "父类动物";
}
class Dog extends Animal{
    public String name = "狼";

    public void showName(){
        String name = "局部变量名";
        System.out.println(name);//局部变量名
        System.out.println(this.name);//指向本类的name
        System.out.println(super.name);//指向父类的name
    }
}
